package com.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.youtu.model.CategoryThing;
import org.youtu.service.CategoryThingService;

import com.google.gson.Gson;


/**
 * 闲置控制器
 * @author linyongjiang
 *
 */
@Controller
@RequestMapping("/home")
public class HomeController {
	 @Autowired
	 private CategoryThingService categoryThingService;
	 
	 /**
	  * 获取闲置物品分类集合
	  * @return
	  */
	 @RequestMapping("/getThingCategoryList")
	 @ResponseBody
	 public String getThingCategoryList(){
		 List<CategoryThing> list = categoryThingService.all();
		 Gson gson = new Gson();
		 return gson.toJson(list);
	 }
}
